<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<sql:setDataSource driver="com.mysql.jdbc.Driver" 
	url="jdbc:mysql://localhost:3306/bookstore"
	user="bkadmin"
	password="nozama"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Books for <%= request.getParameter("catName") %></title>
</head>
<body>
	<c:set var="catid" value='<%= request.getParameter("catId")%>'></c:set>
	<sql:query var="book" sql="SELECT * FROM BOOKS WHERE BOOK_CATEGORY=?">
	<sql:param value="${catid}"></sql:param>
	</sql:query>
	
	<c:forEach var="row" items="${book.rows}">
	<li>
	<a href="book?bookId=${row.book_id}&bookName=${row.book_title}">
		<c:out value="${row.book_title}"></c:out>
	</a>
	</li> 
	</c:forEach>
</body>
</html>